<template>
	<view v-for="(item,index) in 5">
		v-for-{{index+1}}
	</view>
	<view v-for="(item,index) in nba" :key="index">
		球星：{{item.name}}-球衣：{{item.num}}
	</view>
	<view v-for="(item,index) in nba" :key="item.id">
		球星：{{item.name}}-球衣：{{item.num}}
	</view>
	<ul>
		<!-- template中使用 v-for-->
		<template v-for="(item,index) in nba" :key="item.id">
			<li>序号：{{item.id}}  球星：{{item.name}}  球衣：{{item.num}}</li>
		</template>
	</ul>
</template>

<script setup>
	import {ref} from "vue";
	const nba = ref([
		{id:1,name:'科比',num:24},
		{id:2,name:'詹姆斯',num:6},
		{id:3,name:'乔丹',num:32},
	])
</script>

<style lang="scss" scoped>
	       
</style>
